package com.ssy.lingxi.contract.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 合同执行情况
 * @author 伍将
 * @date 2021/3/9
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "con_contract_execute_info",
        indexes = {@Index(name = "con_contract_execute_info_contract_id_idx", columnList = "contractId"),
                @Index(name = "con_contract_execute_info_order_time_idx", columnList = "orderTime"),
                @Index(name = "con_contract_execute_info_order_idx", columnList = "contractId,orderId,orderType,isHasTax,taxRate")})
public class ContractExecuteInfoDO implements Serializable {

    private static final long serialVersionUID = 254276668101429087L;

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "contract_execute_info_seq")
    @SequenceGenerator(sequenceName = "con_contract_execute_info_seq", name = "contract_execute_info_seq", allocationSize = 1)
    private Long id;

    /**
     * 合同id
     */
    @Column(columnDefinition = "int8")
    private Long contractId;

    /**
     * 单据Id
     */
    @Column(columnDefinition = "int8")
    private Long orderId;

    /**
     * 单据编号
     */
    @Column(columnDefinition = "varchar(50)")
    private String orderNO;

    /**
     * 单据摘要
     */
    @Column(columnDefinition = "varchar(60)")
    private String orderAbstract;

    /**
     * 单据类型：1-订单，2-退货申请单
     * ContractOrderTypeEnum
     */
    @Column(columnDefinition = "int")
    private Integer orderType;

    /**
     * 单据时间
     */
    @Column(columnDefinition = "int8")
    private Long orderTime;

    /**
     * 单据金额
     */
    @Column(columnDefinition = "decimal")
    private Double orderAmount;

    /**
     * 是否含税：0-否，1-是
     * CommonBooleanEnum
     */
    @Column(columnDefinition = "int")
    private Integer isHasTax;

    /**
     *  税率
     */
    @Column(columnDefinition = "decimal")
    private Double taxRate;

    /**
     * 已付款
     */
    @Column(columnDefinition = "decimal")
    private Double payAmount;

    /**
     * 已请款待付款
     */
    @Column(columnDefinition = "decimal")
    private Double unPayApplyAmount;

    /**
     * 创建时间
     */
    @Column(columnDefinition = "int8")
    private Long createTime;

    /**
     * 更新时间
     */
    @Column(columnDefinition = "int8")
    private Long updateTime;

    @Transient
    private Double tempAmount;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getContractId() {
        return contractId;
    }

    public void setContractId(Long contractId) {
        this.contractId = contractId;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNO() {
        return orderNO;
    }

    public void setOrderNO(String orderNO) {
        this.orderNO = orderNO;
    }

    public String getOrderAbstract() {
        return orderAbstract;
    }

    public void setOrderAbstract(String orderAbstract) {
        this.orderAbstract = orderAbstract;
    }

    public Integer getOrderType() {
        return orderType;
    }

    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }

    public Long getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Long orderTime) {
        this.orderTime = orderTime;
    }

    public Double getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(Double orderAmount) {
        this.orderAmount = orderAmount;
    }

    public Integer getIsHasTax() {
        return isHasTax;
    }

    public void setIsHasTax(Integer isHasTax) {
        this.isHasTax = isHasTax;
    }

    public Double getTaxRate() {
        return taxRate;
    }

    public void setTaxRate(Double taxRate) {
        this.taxRate = taxRate;
    }

    public Double getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Double payAmount) {
        this.payAmount = payAmount;
    }

    public Double getUnPayApplyAmount() {
        return unPayApplyAmount;
    }

    public void setUnPayApplyAmount(Double unPayApplyAmount) {
        this.unPayApplyAmount = unPayApplyAmount;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public Double getTempAmount() {
        return tempAmount;
    }

    public void setTempAmount(Double tempAmount) {
        this.tempAmount = tempAmount;
    }
}
